<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <link rel="icon" href="https://www.bilibili.com/favicon.ico">
    <style>
        .class01 {
            color: aqua;
            animation: reverse;
        }
    </style>
</head>

<body>
    <div id="root">
        <div id="test" class="" :class='mode' @click='changeMoudle '>点我更换样式</div>
    </div>
    <script>
        Vue.config.productionTip = false
        const vm = new Vue({
            el: '#root ',
            data: {
                mode: 'class01',
            },
            methods: {
                changeMoudle(event) {
                    console.log(event.target);
                    console.log(this);
                    this.mode = 'class02'
                }
            }
        })
    </script>
</body>

</html>